import { Admin } from "./../interface/index";
import http from "@/api";

/**
 * @name 用户管理模块
 */
// 获取用户列表
export const getUserList = (params: Admin) => {
  return http.get("/pm/product/pub/v1/users/list", params);
};

// 新增用户
export const addUser = (params: Admin) => {
  return http.post("/pm/product/pub/v1/users/add", params);
};

// 用户详情
export const getUserInfo = (userId: string) => {
  return http.get(`/pm/product/pub/v1/users/${userId}`);
};

// 删除用户
export const deleteUser = (userId: string) => {
  return http.delete(`/pm/product/pub/v1/users/delete/${userId}`);
};

// 重置用户密码
export const resetUserPassWord = (params: { newPassword: string; oldPassword: string }) => {
  return http.put("/pm/product/pub/v1/users/modifyPassword", params);
};
